#pragma once

#include "myRBTree.h"

namespace gp
{
	template <class K>
	class set
	{
		struct SetofKey
		{
			const K& operator()(const K& key)
			{
				return key;
			}
		};

	public:
		typedef typename RBTree<K, K, SetofKey>::const_iterator iterator;
		typedef typename RBTree<K, K, SetofKey>::const_iterator const_iterator;

		pair<iterator,bool> insert(const K& data)
		{
			pair<RBTree<K, K, SetofKey>::iterator, bool> ret = _t.Insert(data);
			return {ret.first, ret.second};
		}

		const_iterator begin()const
		{
			return _t.begin();
		}

		const_iterator end()const
		{
			return _t.end();
		}

	private:
		RBTree<K, K, SetofKey> _t;
	};

};
